let Router=require('koa-router')
let router=new Router({prefix:'/cart'})
let {add,findAll,deleteCart}=require('../control/cart.js')
let {auth}=require('../middleware/auth.js')
let {validator}=require('../middleware/cart.js')

router.post('/add',auth,validator({
    goods_id:'string',
    num:'string',
    selected:"string"
}),add)

router.get('/',auth,findAll)

router.post('/delete',auth,validator({
    id:'string'
}),deleteCart)

module.exports=router